<%@ page import="com.ktjy.entity.UserAco" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
        <%@ page contentType="text/html;charset=UTF-8" language="java" %>
            <html>

            <head>
                <title>修改图书信息</title>
                <style>
                    body {
                        font-family: Arial, sans-serif;
                        background-color: #f5f5f5;
                    }

                    .container {
                        width: 500px;
                        margin: 50px auto;
                        padding: 20px;
                        background-color: white;
                        border-radius: 8px;
                        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
                    }

                    h1 {
                        color: #333;
                        margin-bottom: 30px;
                    }

                    .form-group {
                        margin-bottom: 15px;
                    }

                    label {
                        display: inline-block;
                        width: 100px;
                        text-align: right;
                        margin-right: 15px;
                    }

                    input[type="text"],
                    input[type="datetime-local"],
                    select {
                        width: 250px;
                        padding: 8px;
                        border: 1px solid #ddd;
                        border-radius: 4px;
                    }

                    input[type="submit"] {
                        background-color: #4CAF50;
                        color: white;
                        padding: 10px 20px;
                        border: none;
                        border-radius: 4px;
                        cursor: pointer;
                        margin-top: 20px;
                    }

                    input[type="submit"]:hover {
                        background-color: #45a049;
                    }
                </style>
            </head>

            <body>
                <% UserAco user=(UserAco) session.getAttribute("user"); if(user==null){
                    response.sendRedirect("index.jsp"); } %>
                    <div class="container">
                        <h1>修改图书信息</h1>
                        <form action="update" method="get">
                            <input type="hidden" name="bid" value="${book.bid}">

                            <div class="form-group">
                                <label for="bName">图书名称:</label>
                                <input type="text" id="bName" name="bName" value="${book.bName}" required>
                            </div>

                            <div class="form-group">
                                <label for="bAuthor">图书作者:</label>
                                <input type="text" id="bAuthor" name="bAuthor" value="${book.bAuthor}" required>
                            </div>

                            <div class="form-group">
                                <label for="bTime">购买日期:</label>
                                <input type="datetime-local" id="bTime" name="bTime" value="${book.bTime}" required>
                            </div>

                            <div class="form-group">
                                <label for="bType">图书类别:</label>
                                <select id="bType" name="bType">
                                    <option value="0" <c:if test="${book.bType==0}">selected</c:if>>计算机/软件</option>
                                    <option value="1" <c:if test="${book.bType==1}">selected</c:if>>小说/文摘</option>
                                    <option value="2" <c:if test="${book.bType==2}">selected</c:if>>杂项</option>
                                </select>
                            </div>

                            <div class="form-group" style="text-align: center;">
                                <input type="submit" value="修改图书信息">
                            </div>
                        </form>
                    </div>
            </body>

            </html>